package cn.edt.ctbu.thymeleaf.service;


import cn.edt.ctbu.thymeleaf.domain.Student;
import cn.edt.ctbu.thymeleaf.repository.StudentRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public interface StudentService {

    //        只支持分页的查询
    Page<Student> findAll(Pageable pageable);

    //分页，带过滤的查询
    public Page<Student> findAll(Example<Student> student,Pageable pageable);

    //    获取所有学生数据
    List<Student> findAll();


    Student insert(Student student);
    Student update(Student student);
    void delete(Student student);

    void delete(Integer id);

    public List<Student> findByName(String name);

    public List<Student> findByNo(String no);
    public List<Student> findBySex(Integer sex);

    Student getById(Integer id);
    public Student validateUsernameAndPassword(String username,String password) throws Exception;

    public List<Student> findByNameAndPassword(String name,String password);
}
